package com.yanxi.mapper;

import com.yanxi.pojo.Clazz;
import com.yanxi.pojo.EmpQueryParam;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ClazzMapper {

    List<Clazz> pageClazz(EmpQueryParam empQueryParam);

    @Delete("delete from clazz where id=#{id}")
    void delete(Integer id);

    @Insert("insert into clazz(name,room,begin_date,end_date,master_id,subject,update_time,create_time) values( #{name},#{room},#{beginDate},#{endDate},#{masterId},#{subject},#{updateTime} ,#{createTime})")
    void save(Clazz clazz);

    @Select("select id, name,room,begin_date,end_date,master_id,subject,create_time,update_time from clazz where id=#{id}")
    Clazz findById(Integer id);



    //@Update("update clazz set name=#{name},room=#{room},begin_date=#{beginDate},end_date=#{endDate},master_id=#{masterId},subject=#{subject},update_time=#{updateTime} where id=#{id}")
    void update(Clazz clazz);

    @Select("select id, name,room,begin_date,end_date,master_id,subject,create_time,update_time from clazz")
    List<Clazz> listAll();



}
